<template>
  <div class="certificate">
    <div class="imgbox m-t-20">
      <el-image class="img m-l-20" :src="url" />
    </div>
    <div class="btnbox m-t-20">
      <el-button class="btn" type="success" @click="handleDownCert">下载证书</el-button>
    </div>
  </div>
</template>

<script>
import codeIMG from '@/assets/maintenance/bazs.png'
export default {
  data() {
    return {
      url: require('@/assets/maintenance/bazs.png')
    }
  },
  mounted() {
    this.$storage.set('upUrl', JSON.stringify({ 'path': '/maintenanCompany/certificate' }))
  },
  methods: {
    handleDownCert() {
      var a = document.createElement('a')
      a.download = name || '维保备案证书'
      // 设置图片地址
      a.href = codeIMG
      a.click()
    }
  }
}
</script>

<style lang="scss">
.certificate {
  width: 100%;
  height: 100%;
  .imgbox {
    display: flex;
    justify-content: center;
    flex: 1;
    .img {
      width: 600px;
      height: 700px;
    }
  }
  .btnbox {
    display: flex;
    justify-content: center;
  }
}
</style>
